function ContentManager(stage, width, height) {
	var ondownloadcompleted;

	var NUM_ELEMENTS_TO_DOWNLOAD = 15;

	var numElementsLoaded = 0;

	var downloadProgress;

	var myAudio = document.createElement('audio');

	this.SetDownloadCompleted = function (callbackMethod) {
		ondownloadcompleted = callbackMethod; //call to function startgame after download complete 
	}

	/*Declare images*/
	this.btn_connect_facebook	= new Image();
	this.btn_music_on 			= new Image();
	this.btn_music_off			= new Image();
	this.bg_ruby				= new Image();
	this.top_game				= new Image();

	//welcome scene
	this.bg_main 				= new Image();
	this.btn_play 				= new Image();
	this.banner					= new Image();
	this.topbar_main 			= new Image();
	
	//In game
	this.btn_share_facebook	    = new Image();
	this.bg_attension			= new Image();	
	//Result Scene
	this.frame_congratulation 	= new Image();
	this.btn_continue 			= new Image();
	this.item_answer			= new Image();	
	this.item_offer				= new Image();

	this.btn_open_1char			= new Image();
	this.btn_share				= new Image();
	this.btn_help				= new Image();



	this.StartDownload = function() {
		downloadProgress = new Text('Downloading 0 %', 'bold 14px Arial', '#FFF');
		downloadProgress.x = (width / 2) - 50;
		downloadProgress.y = height / 2;

		stage.addChild(downloadProgress);


		// ÂM thanh phàn khởi động
		//SetAudioDownloadParameters(this.sStartBegin, "sound/start_begin.mp3");
		//	SetAudioDownloadParameters(this.sStartLaw, "sound/start_law.mp3");
		//SetAudioDownloadParameters(this.sStart, "sound/start.mp3");

		SetDownloadParameters(this.bg_main, 'img/image/bg_main.jpg');
		SetDownloadParameters(this.top_game	, 'img/image/top-game.png');
		SetDownloadParameters(this.btn_music_on, 'img/image/play.png');
		SetDownloadParameters(this.btn_music_off, 'img/image/pause.png');
		SetDownloadParameters(this.btn_connect_facebook, 'img/image/login_facebook.png');
		SetDownloadParameters(this.bg_ruby, 'img/image/ruby.png');

		//WelcomeScene Resources
		SetDownloadParameters(this.btn_play, 'img/image/btn_play.png');
		SetDownloadParameters(this.topbar_main, 'img/image/topbar.png');
		SetDownloadParameters(this.banner, 'img/image/game_picture_default_image.png');

		//ResultScene Resources
		SetDownloadParameters(this.frame_congratulation, 'img/image/congratulation.png');
		SetDownloadParameters(this.btn_continue, 'img/image/btn_continue.png');
		SetDownloadParameters(this.item_answer, 'img/image/item_answer.png');
		SetDownloadParameters(this.item_offer, 'img/image/item_offer.png');
		SetDownloadParameters(this.bg_attension, 'img/image/attension.png');



		//MainScene Resources
		SetDownloadParameters(this.btn_open_1char, 'img/image/btn_open_1char.png');
		SetDownloadParameters(this.btn_share, 'img/image/btn_share.png');
		SetDownloadParameters(this.btn_share_facebook, 'img/image/share-fb.png');
		SetDownloadParameters(this.btn_help, 'img/image/help.png');
	};

	function SetDownloadParameters(assetElement, url) {
		assetElement.src = url;
		assetElement.onload = handleElementLoad;
		assetElement.onerror = handleElementError;
	};


   	function SetAudioDownloadParameters(assetElement, url) {
   		//console.log(assetElement + " download");
    	assetElement.src = url;
    	assetElement.load();
    };

	//our global handler
	function handleElementLoad(e) {
		tickLoad();
		//console.log("Downloading " + Math.round((numElementsLoaded/NUM_ELEMENTS_TO_DOWNLOAD)*100) + ' %');
		if (numElementsLoaded === NUM_ELEMENTS_TO_DOWNLOAD) {
			window.setTimeout(1000);
			stage.removeChild(downloadProgress);
			numElementsLoaded = 0;
			getSounds(ondownloadcompleted);
		} else {
			numElementsLoaded++;
		}
	}

	function handleElementError(e) {
		console.log("Error Loading Asset: " + e.target.src);
	}

	function tickLoad() {
		downloadProgress.text = "Downloading " + Math.round((numElementsLoaded/NUM_ELEMENTS_TO_DOWNLOAD)*100) + ' %';
	};
}	


function getSounds(callbackMethod){
	var audioPath = "sound";
	var NUM_OF_SOUNDS = 5;
	var loadedFiles = 0;
	var callback = callbackMethod;
	manifest = [
	{
		id:"click",
		src: audioPath + "/click.wav"
	},

	{
		id:"over",
		src: audioPath + "/over.ogg"
	},

	{
		id:"right",
		src: audioPath + "/right.mp3"
	},

	{
		id:"pass",
		src: audioPath + "/pass.ogg"
	},

	{
		id:"bravo",
		src: audioPath + "/bravo.mp3"
	},
	];

	createjs.Sound.addEventListener('fileload', handleLoad);
	createjs.Sound.registerManifest(manifest);


	function handleLoad(event){
		loadedFiles++;
		if(loadedFiles == NUM_OF_SOUNDS){
			console.log("load xong âm thanh");
			callback();
		}
	}
}